package com.zycfc.zsf.boot.web.util;

import com.zycfc.zsf.boot.exception.*;
import com.zycfc.zsf.boot.core.web.data.*;
import com.zycfc.zsf.boot.exception.type.*;

public class ServiceExceptionUtils extends ServiceException
{
    private static final long serialVersionUID = 1L;
    
    @Deprecated
    public ServiceExceptionUtils(final IExceptionCode code) {
        super(code);
    }
    
    @Deprecated
    public ServiceExceptionUtils(final IExceptionCode code, final Throwable throwable) {
        super(code, throwable);
    }
    
    public static ServiceException set(final DataResponse<?> dataResponse) {
        final DataResponseExceptionCode code = new DataResponseExceptionCode(dataResponse.getCode(), dataResponse.getMessage());
        return new ServiceException((IExceptionCode)code);
    }
}
